{% extends 'mytym/base.html' %}

{% block content %}
<div class="post">
<form action="." method="post">
    <table>
        <tr>
            <th>
                {{form.job.label_tag}}
            </th>
            <th>
                {{form.name.label_tag}}
            </th>
            <th>
                {{form.hours_worked.label_tag}}
            </th>            
        </tr>
        {% for form in forms %}
        <tr>
            <td>
               {{form.job}}
               {{form.job.errors.0}}
            </td>
            <td>                
               {{form.name}}
               {{form.name.errors.0}}
            </td>
            <td>                
               {{form.hours_worked}}
               {{form.hours_worked.errors.0}}
            </td>            
        </tr>        
        {% endfor %}
    </table> 
    <input type="submit" name="submit" value="Create Job" />
</form>
</div>

<div class="post">
    <table>
        <tr>
            <th>
                Job Name
            </th>
            <th>
                Event Name
            </th>
            <th>
                Hours worked
            </th>            
        </tr>
    {%for entry in entries %}
        <tr>
            <td>
               <a href="{{entry.job.get_absolute_url}}">{{entry.job.name}}</a>
            </td>
            <td>                
               <a href="{{entry.get_absolute_url}}">{{entry.name}}</a>
            </td>
            <td>                
               {{entry.hours_worked}}
            </td>            
        </tr>   
    {% endfor %}
    </table>
</div>



{% endblock %}
